﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="profile.aspx.vb" Inherits="AssignmentProject.profile" %>
<%@ Register assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" namespace="System.Web.UI.DataVisualization.Charting" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
       <script type="text/javascript">
           $(document).ready(function () {

               $(".dropdown dt a").click(function () {
                   $(".dropdown dd ul").toggle();
               });

               $(".dropdown dd ul li a").click(function () {
                   var text = $(this).html();
                   $(".dropdown dt a span").html(text);
                   $(".dropdown dd ul").hide();
                   $("#posttype").val(getSelectedValue("postchoice"));
               });

               function getSelectedValue(id) {
                   return $("#" + id).find("dt a span.value").html();
               }

               $(document).bind('click', function (e) {
                   var $clicked = $(e.target);
                   if (!$clicked.parents().hasClass("dropdown"))
                       $(".dropdown dd ul").hide();
               });



           });
    </script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#Button2").toggle(
       function () {
           $("#usercharts").slideDown(300);

       },
       function () {
           $("#usercharts").fadeOut(600);

       }
       );
        });
    </script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#Button3").toggle(
       function () {
           $("#updatePane").slideDown(300);

       },
       function () {
           $("#updatePane").fadeOut(600);

       }
       );
        });
    </script>
<style type="text/css">
		#usercharts { display:none;}
        #updatePane {display:none;}
        .statscontent {width: 800px; min-width: 800px;}
        .messagecontent{min-width: 800px; text-align:center;}
        .sideBside {width: 400px; min-width:400px;float:left;}
        </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpMainContent" runat="server">

    <div>

    <asp:Label ID="User_LBL" runat="server" Text="Label"></asp:Label>

    <br />
    <div>
     <div class="clearFloats">
    <img alt="User Photo" class="detailedImage" src="<%=GetMemberImagePath() %>"/> 
    </div>  </div>
    <br />
        <asp:Label ID="Label3" runat="server" Text="Age"></asp:Label>
    <br />
    <asp:Label ID="Age_LBL" runat="server" Text="Label"></asp:Label>
    <br />
    <br />
        <asp:Label ID="Label4" runat="server" Text="A bit about me.."></asp:Label>
    <br />
    <asp:Label ID="ProfileDesc_LBL" runat="server" Text="Label"></asp:Label>
    <br />
    <br />
        <asp:Label ID="Label5" runat="server" Text="Starting Weight"></asp:Label>
    <br />
    <asp:Label ID="StartingWeight_LBL" runat="server" Text="Label"></asp:Label>
    <br />
    <br />
        <asp:Label ID="Label6" runat="server" Text="My Target Weight"></asp:Label>
    <br />
     <asp:Label ID="TargetWeight_LBL" runat="server" Text="Label"></asp:Label>
     <div>
     <div>
        
            <br />
            <br />
            <asp:Button ID="Button5" runat="server" Text="Edit Profile" PostBackUrl="~/editprofile.aspx" />
            <br />
            <br />
        </div>
            
    <asp:Button ID="BTN_Friends" runat="server" PostBackUrl="~/locatefriends.aspx" 
        Text="Search Users" />
     </div>
    <asp:SqlDataSource 
           ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
            DatasourceMode="DataReader"
            SelectCommand="SELECT * FROM [Profile] WHERE ([DieterName] = ?)"
            onSelecting="SqlDataSource2_Selecting">
         <SelectParameters>
             <asp:Parameter Name="DieterName" Type="String" DefaultValue="{0}" />
         </SelectParameters>
            
        </asp:SqlDataSource>

</div>
   

     <asp:SqlDataSource 
           ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
            DatasourceMode="DataReader"
            
        
        SelectCommand="SELECT [Weight], [Posted], [Member] FROM [weights] WHERE ([Member] = ?)">
            
         <SelectParameters>
             <asp:QueryStringParameter DefaultValue="{0}" Name="Member" 
                 QueryStringField="DieterName" Type="String" />
         </SelectParameters>
            
        </asp:SqlDataSource>
    <br />

    <div id="statsContent" class="statscontent">
    <div class="sideBside">
    <asp:Button ID="Button2" runat="server" Text="Open/Close Stats" clientidMode="Static"/>
    <br />
    <br />
    <div id="usercharts" clientidmode="Static">


 
        <asp:Chart ID="Chart1" runat="server" DataSourceID="SqlDataSource1">
            <series>
                <asp:Series Name="Series1" ChartType="Line" XValueMember="Posted" 
                    YValueMembers="Weight">
                </asp:Series>
            </series>
            <chartareas>
                <asp:ChartArea Name="ChartArea1">
                </asp:ChartArea>
            </chartareas>
        </asp:Chart>
    </div>
       </div>
       <div class="sideBside">
        <asp:Button ID="Button3" runat="server" Text="Open/Close update pane" ClientIDMode="Static" />
        <div id="updatePane" clientidmode="Static">
        
            <br />
            <asp:Label ID="Label2" runat="server" Text="How have you done? Tell us your current weight."></asp:Label>
            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><asp:CompareValidator ID="CompareValidator1"
                runat="server" ErrorMessage="CompareValidator" ControlToValidate="TextBox1" Operator="DataTypeCheck" Type="Double"></asp:CompareValidator>
            <br />
            <br />
            <asp:Button ID="Button4" runat="server" Text="Submit" />
            <br />
        </div>
    </div>
    </div>
    &nbsp
    <div class="statscontent">
    <h6>You will find any message you've received from other members here in your profile section.</h6><br />
     
    
    <div class="messagecontent">
    
        <asp:Label ID="Label7" runat="server" Text="Your Messages"></asp:Label>
    
    </div>
      <div class="statscontent">
      
          <br />
          <br />
          <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
              DataKeyNames="ID" DataSourceID="SqlDataSource3" GridLines="None" 
              HorizontalAlign="Center">
              <Columns>
                  <asp:BoundField DataField="PostTime" HeaderText="Posted" 
                      SortExpression="PostTime" />
                  <asp:BoundField DataField="Member" HeaderText="Member" 
                      SortExpression="Member" />
                  <asp:HyperLinkField DataNavigateUrlFields="ID" 
                      DataNavigateUrlFormatString="mymessages.aspx?ID={0}" Text="View Message" />
              </Columns>
          </asp:GridView>
          <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
              ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
              ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
              
              SelectCommand="SELECT [ID], [Member], [Message], [PostTime], [Recipient], [Title] FROM [UserMessages] WHERE ([Recipient] = ?)">
              <SelectParameters>
                  <asp:QueryStringParameter DefaultValue="{0}" Name="Recipient" 
                      QueryStringField="DieterName" Type="String" />
              </SelectParameters>
          </asp:SqlDataSource>
          <br />
      
      </div>
        </div>
       <p>     
    </p>


    </asp:Content>
